//
//  ContentView.swift
//  TextFieldDemo
//
//  Created by jerry on 2020/6/23.
//  Copyright © 2020 jerry. All rights reserved.
//

import SwiftUI

struct ContentView: View {
    @State private var text = ""
    
    var body: some View {
        VStack
            {
                TextField(
                    "输入框提示信息",
                    text: $text,
                    onEditingChanged: { (isChanged) in  if isChanged {
                        print("changed")
                    } else {
                        print("unchanged")
                        } },
                    onCommit: { print("commit") }
                )
        }
        
    }
}


struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
